home *** CD-ROM | disk | FTP | other *** search
- .MODEL SMALL
-
- INCLUDE equates.inc
- INCLUDE instance.inc
- INCLUDE messages.inc
- INCLUDE objects.inc
-
- IF1
- INCLUDE macros.mac
- INCLUDE objects.mac
- ENDIF
-
- EXTRN prtString:NEAR
- EXTRN sendMsg:NEAR
-
- EXTRN DBorder:WORD
- EXTRN Dispatch:WORD
- EXTRN Menu:WORD
- EXTRN Mouse:WORD
- EXTRN PopUp:WORD
- EXTRN Self:WORD
- EXTRN System:WORD
-
- .CODE
-
- PUBLIC disVertMenu
- COMMENT %
- ==============================================================================
- Displays a vertical menu.
-
- =============================================================================%
- disVertMenu PROC NEAR
- getInst dh,Row1,Self ;Get upper row
- getInst dl,Col1 ;Get left column
- getInst ch,Row2 ;Get lower row
- getInst bl,Color ;Get color
- getInst di,MenuPtr ;Menu pointer
-
- dec ch ;Decrement lower row
- inc dl ;Account for left border
-
- dvm1: inc dh ;Increment row
- mov Wptr[di],dx ;Save row/column
- mov si,Wptr[di+2] ;Pass ptr to text string
- call prtString ;Display menu item
- add di,4 ;Point to next menu entry
- neq dh,ch,dvm1 ;Not at bottom? - Loop
-
- ret
- disVertMenu ENDP
-
-
-
- IF Dbug
- PUBLIC hiliteMenuItem
- ENDIF
- COMMENT %
- ==============================================================================
- Hilites the menu item based on mouse location.
-
- =============================================================================%
- hiliteMenuItem PROC NEAR
- getInst bl,Row1,Mouse ;Get mouse row
- getInst si,MenuPtr,Self ;Get menu ptr
- xor ax,ax ;Initialize item counter
-
- hmi1: mov dl,Bptr[si+1] ;Get row for current item
- mov dh,Bptr[si+MenuEntrySize+1] ;Get row for next item
- lessThan bl,dl,hmi4 ;Exit if before item
- lessThan bl,dh,hmi3 ;Done if before next item
- inc ax ;Increment item count
- add si,MenuEntrySize ;Point to next entry
- identity Wptr[si],hmi1,hmi4 ;Loop if more items
- ;Else exit
-
- hmi3: mov cl,MenuEntrySize ;Get entry size
- mul cl ;Calc entry offset
- send Self,Hilite,ax ;Hilite menu item
-
- hmi4: ret
- hiliteMenuItem ENDP
-
-
-
- .DATA
-
- defMsg VertMenu,\
- Refresh,\
- <,,disVertMenu>
-
- defMsg VertMenu,\
- Drag,\
- <,,hiliteMenuItem>
-
- defObj VertMenu,\
- <PopUp,DBorder,Menu,Dispatch>,\
- <>,\
- <Refresh,Drag>
-
-
-
-
- END
-